Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: Dynmaic Table with rows and columns that could be different.
Feedback Type: Question
Product Area: Notes Client
Technical Area: Application Development
Platform: Windows
Release: 8.5.3
Reproducible: -Reproducibility-

I have a dynamic table I am rendering using HTML on a notes client form.

Not only are the rows dynamic, but the # of columns are dynamic as well..

The most columns I will have is 5 and the least is 1.

I want the columns to be equally divided.

I tried the following:

cw := @Text(@Round(100/@Elements(fieldLabels)));
f1 := "<th style=\"width:" + cw + "%\">" + fieldLabels[1] + "</th>";
f2 := @If(@Elements(fieldLabels) > 1;"<th style=\"width:" + cw + "%\">" + fieldLabels[2] + "</th>";"");
f3 := @If(@Elements(fieldLabels) > 2;"<th style=\"width:" + cw + "%\">" + fieldLabels[3] + "</th>";"");
f4 := @If(@Elements(fieldLabels) > 3;"<th style=\"width:" + cw + "%\">" + fieldLabels[4] + "</th>";"");
f5 := @If(@Elements(fieldLabels) > 4;"<th style=\"width:" + cw + "%\">" + fieldLabels[5] + "</th>";"");
fL := @Implode(@Trim(f1 : f2 : f3 : f4 : f5));
html := "<table width=\"100%\" style=\"border-style:solid; border-width: .06em; border-color:rgb(210,210,210); font-family: arial; font-size: 10px;\"><tr style=\"background-color: rgb(43,93,159);color:white; font-weight: bold;\">" + fL + "</tr>";

@If(@Elements(fieldLabels) > 4;
@For(i := 1;i <= @Elements(r1);
i := i + 1;
HTML := HTML + "<TR ><TD VALIGN=TOP >" + r1[i] + "</TD>";
HTML := HTML + "<TD VALIGN=TOP >" + r2[i] + "</TD>";
HTML := HTML + "<TD VALIGN=TOP >" + r3[i] + "</TD>";
HTML := HTML + "<TD VALIGN=TOP >" + r4[i] + "</TD>";
HTML := HTML + "<TD VALIGN=TOP >" + r5[i] + "</TD>";
HTML := HTML + "</TR>");
@Elements(fieldLabels) > 3;
@For(i := 1;i <= @Elements(r1);
i := i + 1;
HTML := HTML + "<TR ><TD VALIGN=TOP >" + r1[i] + "</TD>";
HTML := HTML + "<TD VALIGN=TOP >" + r2[i] + "</TD>";
HTML := HTML + "<TD VALIGN=TOP >" + r3[i] + "</TD>";
HTML := HTML + "<TD VALIGN=TOP >" + r4[i] + "</TD>";
HTML := HTML + "</TR>");
@Elements(fieldLabels) > 2;
@For(i := 1;i <= @Elements(r1);
i := i + 1;
HTML := HTML + "<TR ><TD VALIGN=TOP >" + r1[i] + "</TD>";
HTML := HTML + "<TD VALIGN=TOP >" + r2[i] + "</TD>";
HTML := HTML + "<TD VALIGN=TOP >" + r3[i] + "</TD>";
HTML := HTML + "</TR>");
@Elements(fieldLabels) > 1;
@For(i := 1;i <= @Elements(r1);
i := i + 1;
HTML := HTML + "<TR ><TD VALIGN=TOP >" + r1[i] + "</TD>";
HTML := HTML + "<TD VALIGN=TOP >" + r2[i] + "</TD>";
HTML := HTML + "</TR>");
@For(i := 1;i <= @Elements(r1);
i := i + 1;
HTML := HTML + "<TR ><TD VALIGN=TOP >" + r1[i] + "</TD>";
HTML := HTML + "</TR>"));
HTML

my table is rendering fine, but my columns are not equally divided. If I have 4 columns, each column is not 25%.

The closest, seems to be when it is 3 columns.

If you have a better way of doing this, please let me know. I can live with it.. But I would like my columns to be the same


Feedback number WEBB8WQTXC created by ~Hal Quetlu on 07/31/2012

Status: Open
Comments:

Dynmaic Table with rows and columns... (~Hal Quetlu 31.Jul.12)
. . Try this... (~Dan Kikiterobu... 10.Aug.12)
. . . . thank you (~Hal Quetlu 13.Aug.12)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS